import {List as AntdList} from "antd"
import ShowRedux from "../../components/show-redux"

const getData = () => Array.from({length: 100}, (_, i) => `我是列表项 👉 ${i}`)

const List = () => {
    return (
        <div className="h-full overflow-auto">
            <ShowRedux/>
            <AntdList>
                {/* 注意:
                  * map 里面的根元素必须有 key 属性, 且 key 属性的值必须是唯一的
                  * react 中渲染列表只能用 map, 不能用 forEach, 因为 map 拥有返回值
                 */}
                {getData().map((item, index) => <AntdList.Item key={index}>{item}</AntdList.Item>)}
            </AntdList>
        </div>
    )
}

export default List
